/**
 * Created by jack on 2017/12/14.
 */
'use strict';

goog.provide('Blockly.Arduino.motion');

goog.require('Blockly.Arduino');


Blockly.Arduino['motion_movesteps'] = function(block) {
  var value_steps = Blockly.Arduino.valueToCode(block, 'STEPS', Blockly.Arduino.ORDER_ATOMIC);
  // TODO: Assemble Arduino into code variable.
  var code = '';
  return code;
};


Blockly.Arduino['motion_turnright'] = function(block) {
  var value_rotates = Blockly.Arduino.valueToCode(block, 'DEGREES', Blockly.Arduino.ORDER_ATOMIC);
  // TODO: Assemble Arduino into code variable.
  var code = '';
  return code;
};

Blockly.Arduino['motion_turnleft'] = function(block) {
  var value_rotates = Blockly.Arduino.valueToCode(block, 'DEGREES', Blockly.Arduino.ORDER_ATOMIC);
  // TODO: Assemble Arduino into code variable.
  var code = '';
  return code;
};


Blockly.Arduino['motion_pointindirection'] = function(block) {
  var value_rotates = Blockly.Arduino.valueToCode(block, 'DIRECTION', Blockly.Arduino.ORDER_NONE);
  // TODO: Assemble Arduino into code variable.
  var code = '';
  return code;
};

Blockly.Arduino['motion_gotoxy'] = function(block) {
    var value_x = Blockly.Arduino.valueToCode(block, 'X', Blockly.Arduino.ORDER_ATOMIC);
    var value_y = Blockly.Arduino.valueToCode(block, 'Y', Blockly.Arduino.ORDER_ATOMIC);
    var code = '';
    return code;
};

Blockly.Arduino['motion_setx'] = function(block) {
    var value_x = Blockly.Arduino.valueToCode(block, 'X', Blockly.Arduino.ORDER_ATOMIC);
    var code = '';
    return code;
};


Blockly.Arduino['motion_sety'] = function(block) {
    var value_y = Blockly.Arduino.valueToCode(block, 'Y', Blockly.Arduino.ORDER_ATOMIC);
    var code = '';
    return code;
};

Blockly.Arduino['motion_xposition'] = function(block) {
   var code="";
    return [code, Blockly.Arduino.ORDER_ATOMIC];
};

Blockly.Arduino['motion_yposition'] = function(block) {
   var code="";
    return [code, Blockly.Arduino.ORDER_ATOMIC];
};

Blockly.Arduino['motion_direction'] = function(block) {
   var code="";
    return [code, Blockly.Arduino.ORDER_ATOMIC];
};